import axios from 'axios'
const uploadrequest = axios.create({
    baseURL: 'https://api.yfyh.cc' //请求的基本路径

})
uploadrequest.interceptors.request.use(
    function(config) {
        const user = JSON.parse(window.localStorage.getItem('user'));
        if (user) {
            config.headers={
                Authorization:user.token,
                "Content-Type":"multipart/form-data"
            }
        }
        return config
    },
    function(error) {
        return Promise.reject(error)
    }
)
export default uploadrequest